package com.wqz.taco_cloud_jpa.models;

import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;

import javax.persistence.*;

/**
 * taco的主要配料
 * name和配料type
 * 将领域对象标注为实体
 * JPA实体需要有个无参数构造函数
 */
@Data
@Entity
@Table(name = "Ingredient")
@NoArgsConstructor(force = true)
@RequiredArgsConstructor
public class Ingredient {
    @Id
    private final String id;
    private final String name;

    @Enumerated(EnumType.STRING)
    private final Type type;

    // 这里的type用于在html中动态筛选ingredient成分,html需要和这里一致
    public static enum Type {
        WRAP, PROTEIN, VEGGIES, CHEESES, SAUCES
    }
}
